--*****************************参数设置**********************************--
local ZAxisParam = {
    downPos = 3,      --下降位置
    upPos = 5,        --抬升位置
    Speed = 1000,     --速度mm/s
    Acc = 10,         --加速度m/s^2
    Hold = 0.1,       --保持电流A
    Electricity = 0.2 --电流A
}
--*****************************参数设置**********************************--


local Sensor = ImportModel("SensorBase")
Cia402Device = ImportModel("Cia402DeviceBase")
local Count = 100
Sensor.ForcePort = "COM5"
Sensor.ForceBaud = 115200
local maxPos = {}
local forceId = { 3, 4, 5 }
local forceValue = {}


function CloseCia402(control)
	for i = 1, #control do
        control[i].CloseCia402()
    end
end

local xx, slaveValue = CardMaster:GetSlaveValue(0)
if xx ~= 0 then
    print("获取Ethercat从站错误")
end

print(slaveValue)

local jodell = {}

for i = 1, slaveValue, 1 do
    jodell[i] = Cia402Device.Init("清能")
    jodell[i].AxisId = i-1
    jodell[i].Enable(false)
end

